package lesson

import (
	"context"
	"github.com/gogf/gf/v2/net/ghttp"
	"server/internal/consts"
	"server/internal/service"

	"server/api/lesson/user"
)

func (c *ControllerUser) Detail(ctx context.Context, req *user.DetailReq) (res *user.DetailRes, err error) {
	res = new(user.DetailRes)
	userID := ghttp.RequestFromCtx(ctx).GetCtxVar(consts.CtxLessonUserID, 0)
	detail, err := service.LessonUser().Detail(ctx, userID.Int64())
	res.Data = *detail
	return
}
